<?php

session_start();
include('../../include/dbFunctions.php');
if(isset($_SESSION['sponsor_id'])) {
    $sponsor_id=$_SESSION['sponsor_id'];
}
$table = "contact_sponsor";
$id = $_GET['id'];//id sent by plugin DataTables Editable

$query = "DELETE FROM $table WHERE contact_sponsor_id = $id";
$result = executeQuery($query);
if ($result!=0) {
    $_SESSION['mes'] = "Your contact has been deleted successfully";
} else {
    $_SESSION['mes'] = "Error! Please try again";
}
$link = "../sponsorView.php?id=$sponsor_id";
header("Location: $link ");


?>
